<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>Log4Net使用指南 - 最远距离 - 博客园</title>
<meta name="keywords" content="Log4Net使用指南">
<meta name="description" content="几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后，就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。  经验表明，日志记录往往是软件开发周期中的重要组成部分。......">




<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/lwlzyjl/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/lwlzyjl/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html" id="Form1">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>

        
<!--done-->
<div id="header">
	
<!--done-->
<div class="header">
	<div class="headerText">
		<a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/lwlzyjl/">最远距离</a><br>
		                    ---.Net之路
	</div>
</div>

</div>
<div id="mylinks">
<!--done-->
<a id="MyLinks1_HomeLink" class="menu" href="http://www.cnblogs.com/">博客园</a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/lwlzyjl/">首页</a>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/%e6%9c%80%e8%bf%9c%e8%b7%9d%e7%a6%bb">联系</a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/lwlzyjl/rss">订阅</a><a id="MyLinks1_XMLLink" href="http://www.cnblogs.com/lwlzyjl/rss"><img src="xml.gif" alt="订阅" style="border-width: 0px;"></a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/lwlzyjl/admin/EditPosts.aspx">管理</a>
</div>
<div id="mytopmenu">
	
		
<div class="blogStats">随笔 - 29&nbsp;
文章 - 1&nbsp;评论 - 76&nbsp;trackbacks - 2
</div>
	
</div>
<div id="leftcontent">
	
		<div id="leftcontentcontainer">
			<br>
			
<!--done-->
<div class="newsItem">
	<div id="ads" style="border: 1px solid rgb(169, 214, 226); margin: 10px 0px 6px; clear: both; width: 180px;">


<h3 style="border-bottom: 1px dashed rgb(161, 216, 230); padding: 2px 0px 0px 12px; font-size: 12px; color: rgb(102, 102, 102); line-height: 24px; height: 24px; text-align: left;">赞助商广告</h3>

<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 150px; position: relative; visibility: visible; width: 180px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 150px; position: relative; visibility: visible; width: 180px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_1.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="150" width="180"></iframe></ins></ins>
<br>
 
<img src="alimamal.php" name="alimamatmpf0.6301472572778314" id="alimamatmpf0.6301472572778314" style="border: 0px none ; margin: 0px; padding: 0px; width: 0px; height: 0px; vertical-align: baseline;" border="0"><iframe name="alimamaf0.6301472572778314" id="alimamaf0.6301472572778314" border="0" marginwidth="0" marginheight="0" style="width: 180px; height: 250px;" src="index_2.html" scrolling="no" frameborder="0"></iframe>
</div>
<div id="profile_block"><a href="http://home.cnblogs.com/lwlzyjl/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/lwlzyjl/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/lwlzyjl/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e6%9c%80%e8%bf%9c%e8%b7%9d%e7%a6%bb" target="_top">发短消息</a></div>
</div>

			

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<h3>常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/lwlzyjl/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl01_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/lwlzyjl/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/tag/">我的标签</a></li>
	</ul>
</div>
<!--done-->

		<h1 class="catListTitle">随笔分类</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89131.html">Ajax</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to Ajax" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89131.html/rss"><img title="Subscribe to Ajax" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89043.html">Asp.net(2)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to Asp.net(2)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89043.html/rss"><img title="Subscribe to Asp.net(2)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/200093.html">Asp.Net MVC开发指南</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to Asp.Net MVC开发指南" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/200093.html/rss"><img title="Subscribe to Asp.Net MVC开发指南" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89042.html">C#(6)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to C#(6)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89042.html/rss"><img title="Subscribe to C#(6)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89044.html">JavaScript</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to JavaScript" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89044.html/rss"><img title="Subscribe to JavaScript" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89045.html">XML</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to XML" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89045.html/rss"><img title="Subscribe to XML" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/197675.html">翻译文章</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to 翻译文章" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/197675.html/rss"><img title="Subscribe to 翻译文章" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/97199.html">日常积累(3)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to 日常积累(3)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/97199.html/rss"><img title="Subscribe to 日常积累(3)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">随笔档案</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2009/04.html">2009年4月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/12.html">2008年12月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/08.html">2008年8月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05.html">2008年5月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04.html">2008年4月 (4)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01.html">2008年1月 (3)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11.html">2007年11月 (8)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/10.html">2007年10月 (3)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/09.html">2007年9月 (5)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl10_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/08.html">2007年8月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl11_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/06.html">2007年6月 (1)</a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">文章分类</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89046.html">.Net</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to .Net" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89046.html/rss"><img title="Subscribe to .Net" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/132159.html">Spring.Net(1)</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to Spring.Net(1)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/132159.html/rss"><img title="Subscribe to Spring.Net(1)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/130788.html">漫谈设计模式</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to 漫谈设计模式" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/130788.html/rss"><img title="Subscribe to 漫谈设计模式" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">好友的Blog</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_Link" class="listitem" href="http://www.6868368.com/">奇特淘宝网</a></li>
			<li style="margin-top: 2px;">奇特淘宝网</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl02_Link" class="listitem" href="http://hunbj.cn/" target="_top">我的个人网站</a></li>
			<li style="margin-top: 2px;">混北京网站</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_Link" class="listitem" href="http://www.blogjava.net/Alex-Lee/default.aspx" target="_top">小颀的Java窝</a><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_RssLink" title="Subscribe to 小颀的Java窝" class="listitem" href="http://www.blogjava.net/Alex-Lee/default.aspx"><img title="Subscribe to 小颀的Java窝" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">牛人的Blog</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl01_Link" class="listitem" href="http://juqiang.cnblogs.com/" target="_top">鞠强的Blog</a></li>
			<li style="margin-top: 2px;">Inspur出去的高手, 敬仰之~!</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl02_Link" class="listitem" href="http://blog.csdn.net/eparg" target="_top">熊力的Blog</a><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl02_RssLink" title="Subscribe to 熊力的Blog" class="listitem" href="http://blog.csdn.net/eparg/Rss.aspx"><img title="Subscribe to 熊力的Blog" src="xml_001.gif" style="border-width: 0px;"></a></li>
			<li style="margin-top: 2px;">据说是个调试的高手,想买他的书看看!</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl03_Link" class="listitem" href="http://blog.joycode.com/wayfarer/" target="_top">张逸:晴窗笔记</a></li>
			<li style="margin-top: 2px;">WCF的牛人！</li>
				</ul>
			
	


<h3>积分与排名</h3>
<ul>
	<li>
		积分 -
		22160
	</li><li>
		排名 -
		3136
	</li>
</ul>

<h3 class="catListTitle">最新评论
	<a id="SingleColumn1__2e3d8b6_RSSHyperlink1" href="http://www.cnblogs.com/lwlzyjl/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3>
<div class="RecentComment" id="RecentComments">
	
			<ul>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#1735143">1.&nbsp;Re:excel单元格回车的使用 </a>
			</li>
			<li style="">
				非常感谢哈 一直为之个问题头疼哈
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--alisx</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#1733450">2.&nbsp;Re:excel单元格回车的使用 </a>
			</li>
			<li style="">
				非常感谢，及时解决了工作中的问题
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--某某1</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html#1695038">3.&nbsp;Re:Spring.Net入门篇（二）概述 </a>
			</li>
			<li style="">
				写这篇概述，实在让我感觉捉肘见襟，不停的翻阅材料，也许一年以后我再看这篇的文章的时候会发现现在的我是多么的幼稚和可笑，但是我还是写出来了，当作对逝去的时光的一个总结吧！


楼主，你现在看时，可千万别...
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--梅桦</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/12/11/1353112.html#1688875">4.&nbsp;Re:大型网站架构演变和知识体系(转)</a>
			</li>
			<li style="">
				受教了！
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--孤独之影</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html#1672907">5.&nbsp;Re:Spring.Net入门篇（二）概述 </a>
			</li>
			<li style="">
				看得真是太爽啦!

			</li>
			<li style="text-align: right; margin-right: 4px;">
				--我是一只小老虎 喵!</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">阅读排行榜</h3>
<div class="RecentComment" id="TopViewPosts"> 
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/18/1159712.html">1.&nbsp;Spring.Net入门篇（一）(4348)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/08/1142382.html">2.&nbsp;.Net的序列化和反序列化(3604)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html">3.&nbsp;Spring.Net入门篇（二）概述 (3522)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">4.&nbsp;excel单元格回车的使用 (2213)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/08/953258.html">5.&nbsp;NuSoap介绍（转）(1154)</a>
			</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">评论排行榜</h3>
<div class="RecentComment" id="TopCommentsPosts">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html">1.&nbsp;Spring.Net入门篇（二）概述 (31)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/18/1159712.html">2.&nbsp;Spring.Net入门篇（一）(21)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/08/1142382.html">3.&nbsp;.Net的序列化和反序列化(10)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">4.&nbsp;excel单元格回车的使用 (8)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/15/960294.html">5.&nbsp;用Axis开发Webservice(2)</a>
			</li>
		
			</ul>
		
</div></div>		
	
</div>
<div id="centercontent">
	
					
<!--done-->
<div class="post">
	<div class="postTitle">
		<h1><a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html">Log4Net使用指南</a></h1>
	</div>
	<p style="margin-left: 21.25pt; text-indent: -21.25pt;"><strong>1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>简介</strong></p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>1.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Log4net</strong><strong>的优点：</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后，就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">经验表明，日志记录往往是软件开发周期中的重要组成部分。它具有以下几个优点：它可以提供应用程序运行时的精确环境，可供开发人员尽快找到应用程序中的Bug；一旦在程序中加入了Log 输出代码，程序运行过程中就能生成并输出日志信息而无需人工干预。另外，日志信息可以输出到不同的地方（控制台，文件等）以备以后研究之用。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">Log4net就是为这样一个目的设计的，用于.NET开发环境的日志记录包。</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>1.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Log4net</strong><strong>的安装：</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">用户可以从<a href="http://logging.apache.org/log4net/"><span style="color: windowtext; text-decoration: none;">http://logging.apache.org/log4net/</span></a>下载log4net的源代码。解压软件包后，在解压的src目录下将log4net.sln载入Visual Studio .NET，编译后可以得到log4net.dll。用户要在自己的程序里加入日志功能，只需将log4net.dll引入工程即可。</p>
<p style="margin-left: 21.25pt; text-indent: -21.25pt;"><strong>2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Log4net</strong><strong>的结构</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net 有四种主要的组件，分别是Logger（记录器）, Repository（库）, Appender（附着器）以及 Layout（布局）.</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>2.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Logger</strong></p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>2.1.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Logger</strong><strong>接口</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger是应用程序需要交互的主要组件，它用来产生日志消息。产生的日志消息并不直接显示，还要预先经过Layout的格式化处理后才会输出。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger提供了多种方式来记录一个日志消息，你可以在你的应用程序里创建多个Logger，每个实例化的Logger对象都被log4net框架作为命名实体(named entity)来维护。这意味着为了重用Logger对象，你不必将它在不同的类或对象间传递，只需要用它的名字为参数调用就可以了。log4net框架使用继承体系，继承体系类似于.NET中的名字空间。也就是说，如果有两个logger,分别被定义为a.b.c和a.b，那么我们说a.b是a.b.c的祖先。每一个logger都继承了祖先的属性</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Log4net框架定义了一个ILog接口，所有的logger类都必须实现这个接口。如果你想实现一个自定义的logger，你必须首先实现这个接口。你可以参考在/extension目录下的几个例子。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">ILog接口的定义如下：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">public interface ILog</p>
<p style="margin-left: 42pt; text-indent: 21pt;">{</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Debug(object message);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Info(object message);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Warn(object message);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Error(object message);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Fatal(object message);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">//以上的每一个方法都有一个重载的方法，用来支持异常处理。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">//每一个重载方法都如下所示，有一个异常类型的附加参数。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">void Debug(object message, Exception ex);</p>
<p style="margin-left: 42pt; text-indent: 21pt;">// ...</p>
<p style="margin-left: 42pt; text-indent: 21pt;">//Boolean 属性用来检查Logger的日志级别</p>
<p style="margin-left: 42pt; text-indent: 21pt;">//（我们马上会在后面看到日志级别）</p>
<p style="margin-left: 42pt; text-indent: 21pt;">bool isDebugEnabled;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">bool isInfoEnabled;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">//… 其他方法对应的Boolean属性</p>
<p style="margin-left: 42pt; text-indent: 21pt;">}</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Log4net框架定义了一个叫做LogManager的类，用来管理所有的logger对象。它有一个GetLogger()静态方法，用我们提供的名字参数来检索已经存在的Logger对象。如果框架里不存在该Logger对象，它也会为我们创建一个Logger对象。代码如下所示：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">log4net.ILog log = log4net.LogManager.GetLogger("logger-name");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">通常来说，我们会以类（class）的类型（type）为参数来调用GetLogger()，以便跟踪我们正在进行日志记录的类。传递的类(class)的类型(type)可以用typeof(Classname)方法来获得，或者可以用如下的反射方法来获得：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">System.Reflection.MethodBase.GetCurrentMethod().DeclaringType</p>
<p style="margin-left: 42pt; text-indent: 21pt;">尽管符号长了一些，但是后者可以用于一些场合，比如获取调用方法的类(class)的类型(type)。</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>2.1.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>日志的级别</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">正如你在ILog的接口中看到的一样，有五种不同的方法可以跟踪一个应用程序。事实上，这五种方法是运作在Logger对象设置的不同日志优先级别上。这几种不同的级别是作为常量定义在log4net.spi.Level类中。你可以在程序中使用任何一种方法。但是在最后的发布中你也许不想让所有的代码来浪费你的CPU周期，因此，框架提供了7种级别和相应的Boolean属性来控制日志记录的类型。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">Level有以下几种取值</p>
<table style="margin-left: 48.75pt;" border="1" cellpadding="0">
    <tbody>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>级别</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>允许的方法</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>Boolean</strong><strong>属性</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 60.75pt;" width="81">
            <p><strong>优先级别</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>OFF</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 60.75pt;" width="81">
            <p><strong>Highest</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>FATAL</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>void Fatal(...);</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>bool IsFatalEnabled;</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>RROR</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>void Error(...);</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>bool IsErrorEnabled;</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>WARN</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>void Warn(...);</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>bool IsWarnEnabled;</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>INFO</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>void Info(...);</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>bool IsInfoEnabled;</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>DEBUG</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 88.5pt;" width="118">
            <p><strong>void Debug(...);</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 115.5pt;" width="154">
            <p><strong>bool IsDebugEnabled;</strong></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5pt; width: 51.75pt;" width="69">
            <p><strong>ALL</strong></p>
            </td>
            <td style="padding: 1.5pt; width: 60.75pt;" width="81">
            <p><strong>Lowest</strong></p>
            </td>
        </tr>
    </tbody>
</table>
<p style="margin-left: 42pt; text-indent: 21pt; text-align: center;" align="center">表1Logger的日志级别</p>
<p style="margin-left: 42pt; text-indent: 21pt;">在log4net框架里，通过设置配置文件，每个日志对象都被分配了一个日志优先级别。如果没有给一个日志对象显式地分配一个级别，那么该对象会试图从他的祖先继承一个级别值。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">ILog接口的每个方法都有一个预先定义好了的级别值。正如你在表1看到的，ILog的Inof()方法具有INFO级别。同样的，以此类推，Error()方法具有ERROR级别。当我们使用以上的任何一种方法时，log4net框架会检查日志对象logger的级别和方法的级别。只有当方法的级别高于日志级别时，日志请求才会被接受并执行。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">举例说明，当你创建了一个日志对象，并且把他的级别设置为INFO。于是框架会设置日志的每个Boolean属性。当你调用相应的日志方法时，框架会检查相应的Boolean属性，以决定该方法能不能执行。如下的代码：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger.Info("message");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger.Debug("message");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger.Warn("message");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">对于第一种方法，Info()的级别等与日志的级别（INFO），因此日志请求会被传递，我们可以得到输出结果”message”。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">对于第二种方法，Debug()的级别低于日志对象logger的日志级别(INFO)，因此，日志请求被拒绝了，我们得不到任何输出。同样的，针对第三行语句，我们可以很容易得出结论。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">在表1中有两个特殊的级别：ALL和OFF。ALL表示允许所有的日志请求。OFF是拒绝所有的请求。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">你也可以显式地检查Logger对象的Boolean属性，如下所示：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">if (logger.IsDebugEnabled) </p>
<p style="margin-left: 42pt; text-indent: 21pt;">{</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Logger.Debug("message");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">}</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>2.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Repository</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">Repository主要用于负责日志对象组织结构的维护。在log4net的以前版本中，框架仅支持分等级的组织结构(hierarchical organization)。这种等级结构本质上是库的一个实现，并且定义在log4net.Repository.Hierarchy 名字空间中。要实现一个Repository，需要实现log4net.Repository.ILoggerRepository 接口。但是通常并不是直接实现该接口，而是以log4net.Repository.LoggerRepositorySkeleton为基类继承。体系库 (hierarchical repository )则由log4net.Repository.Hierarchy.Hierarchy类实现。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">如果你是个log4net框架的使用者，而非扩展者，那么你几乎不会在你的代码里用到Repository的类。相反的，你需要用到LogManager类来自动管理库和日志对象。</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>2.3<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Appender</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">一个好的日志框架应该能够产生多目的地的输出。比如说输出到控制台或保存到一个日志文件。log4net 能够很好的满足这些要求。它使用一个叫做Appender的组件来定义输出介质。正如名字所示，这些组件把它们附加到Logger日志组件上并将输出传递到输出流中。你可以把多个Appender组件附加到一个日志对象上。 Log4net框架提供了几个Appender组件。关于log4net提供的Appender组件的完整列表可以在log4net框架的帮助手册中找到。有了这些现成的Appender组件，一般来说你没有必要再自己编写了。但是如果你愿意，可以从log4net.Appender.AppenderSkeleton类继承。</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>2.4<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Appender Filters</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">一个Appender 对象缺省地将所有的日志事件传递到输出流。Appender的过滤器(Appender Filters) 可以按照不同的标准过滤日志事件。在log4net.Filter的名字空间下已经有几个预定义的过滤器。使用这些过滤器，你可以按照日志级别范围过滤日志事件，或者按照某个特殊的字符串进行过滤。你可以在API的帮助文件中发现更多关于过滤器的信息。</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>2.5<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>Layout</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">Layout 组件用于向用户显示最后经过格式化的输出信息。输出信息可以以多种格式显示，主要依赖于我们采用的Layout组件类型。可以是线性的或一个XML文件。Layout组件和一个Appender组件一起工作。API帮助手册中有关于不同Layout组件的列表。一个Appender对象，只能对应一个Layout对象。要实现你自己的Layout类，你需要从log4net.Layout.LayoutSkeleton类继承，它实现了ILayout接口。</p>
<p style="margin-left: 21.25pt; text-indent: -21.25pt;"><strong>3<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>在程序中使用log4net</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">在开始对你的程序进行日志记录前，需要先启动log4net引擎。这意味着你需要先配置前面提到的三种组件。你可以用两种方法来设定配置：在单独的文件中设定配置或在代码中定义配置。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">因为下面几种原因，推荐在一个单独的文件中定义配置：</p>
<p style="margin-left: 63pt; text-indent: -21pt;">l<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>你不需要重新编译源代码就能改变配置；</p>
<p style="margin-left: 63pt; text-indent: -21pt;">l<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>你可以在程序正运行的时候就改变配置。这一点在一些WEB程序和远程过程调用的程序中有时很重要；</p>
<p style="margin-left: 21pt; text-indent: 21pt;">考虑到第一种方法的重要性，我们先看看怎样在文件中设定配置信息。<br>
</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>3.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>定义配置文件</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">配置信息可以放在如下几种形式文件的一种中。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">在程序的配置文件里，如AssemblyName.config 或web.config. </p>
<p style="margin-left: 21pt; text-indent: 21pt;">在你自己的文件里。文件名可以是任何你想要的名字，如AppName.exe.xyz等. </p>
<p style="text-align: left;" align="left">log4net框架会在相对于AppDomain.CurrentDomain.BaseDirectory 属性定义的目录路径下查找配置文件。框架在配置文件里要查找的唯一标识是&lt;log4net&gt;<span style="font-size: 12pt; color: rgb(0, 51, 102);">标签。一个完整的配置文件的例子如下：<br>
</span></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;configuration&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;configSections&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;section name="log4net" </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="log4net.Config.Log4NetConfigurationSectionHandler,</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log4net-net-1.0" </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;/configSections&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;log4net&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;root&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;level value="WARN" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appender-ref ref="LogFileAppender" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appender-ref ref="ConsoleAppender" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;/root&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;logger name="testApp.Logging"&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;level value="DEBUG"/&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;/logger&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;appender name="LogFileAppender" </strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="log4net.Appender.FileAppender" &gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="File" value="log-file.txt" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="AppendToFile" value="true" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;layout type="log4net.Layout.PatternLayout"&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="Header" value="[Header]"r"n"/&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="Footer" value="[Footer]"r"n"/&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="ConversionPattern" </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value="%d [%t] %-5p %c [%x]- %m%n"</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/layout&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;filter type="log4net.Filter.LevelRangeFilter"&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="LevelMin" value="DEBUG" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="LevelMax" value="WARN" /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/filter&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;/appender&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp; &lt;appender name="ConsoleAppender" </strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="log4net.Appender.ConsoleAppender" &gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;layout type="log4net.Layout.PatternLayout"&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="ConversionPattern" </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value="%d [%t] %-5p %c [%x] - %m%n" </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/layout&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;"><strong>&nbsp;&nbsp; &lt;/appender&gt;</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;/log4net&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&lt;/configuration&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">你可以直接将上面的文本拷贝到任何程序中使用，但是最好还是能够理解配置文件是怎样构成的。 只有当你需要在应用程序配置文件中使用log4net配置时，才需要在&lt;configSection&gt;标签中加入&lt;section&gt;配置节点入口。对于其他的单独文件，只有&lt;log4net&gt;标签内的文本才是必需的，这些标签的顺序并不是固定的。下面我们依次讲解各个标签内文本的含义：</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.1.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>&lt;root&gt;</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;root&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;level value="WARN" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;appender-ref ref="LogFileAppender" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;appender-ref ref="ConsoleAppender" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/root&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">在框架的体系里，所有的日志对象都是根日志(root logger)的后代。 因此如果一个日志对象没有在配置文件里显式定义，则框架使用根日志中定义的属性。在&lt;root&gt;标签里，可以定义level级别值和Appender的列表。如果没有定义LEVEL的值，则缺省为DEBUG。可以通过&lt;appender-ref&gt;标签定义日志对象使用的Appender对象。&lt;appender-ref&gt;声明了在其他地方定义的Appender对象的一个引用。在一个logger对象中的设置会覆盖根日志的设置。而对Appender属性来说，子日志对象则会继承父日志对象的Appender列表。这种缺省的行为方式也可以通过显式地设定&lt;logger&gt;标签的additivity属性为false而改变。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;logger name="testApp.Logging" additivity="false"&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/logger&gt;</p>
<p style="margin-left: 21pt; text-indent: 21pt;">Additivity的值缺省是true.<br>
<br>
</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.1.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>&lt;Logger&gt;</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;logger name="testApp.Logging"&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;level value="DEBUG"/&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/logger&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;logger&gt; 元素预定义了一个具体日志对象的设置。然后通过调用LogManager.GetLogger(“testAPP.Logging”)函数，你可以检索具有该名字的日志。如果LogManager.GetLogger(…)打开的不是预定义的日志对象，则该日志对象会继承根日志对象的属性。知道了这一点，我们可以说，其实&lt;logger&gt;标签并不是必须的。</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.1.3<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>&lt;appender&gt;</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;appender name="LogFileAppender" </p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="log4net.Appender.FileAppender" &gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;param name="File" value="log-file.txt" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;param name="AppendToFile" value="true" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;layout type="log4net.Layout.PatternLayout"&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;param name="Header" value="[Header]"r"n" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;param name="Footer" value="[Footer]"r"n"/&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;param name="ConversionPattern" </p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value="%d [%t] %-5p %c - %m%n" </p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/layout&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;filter type="log4net.Filter.LevelRangeFilter"&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;param name="LevelMin" value="DEBUG" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; &lt;param name="LevelMax" value="WARN" /&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/filter&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&lt;/appender&gt;</p>
<p style="margin-left: 42pt; text-indent: 21pt;">在&lt;root&gt;标签或单个的&lt;logger&gt;标签里的Appender对象可以用&lt;appender&gt;标签定义。&lt;appender&gt;标签的基本形式如上面所示。它定义了appender的名字和类型。 另外比较重要的是&lt;appender&gt;标签内部的其他标签。不同的appender有不同的&lt;param&gt;标签。在这里，为了使用FileAppender,你需要一个文件名作为参数。另外还需要一个在&lt;appender&gt;标签内部定义一个Layout对象。Layout对象定义在它自己的&lt;layout&gt;标签内。&lt;layout&gt;标签的type属性定义了Layout的类型(在本例里是PatternLayout)，同时也确定了需要提供的参数值。Header和Footer标签提供了一个日志会话(logging session)开始和结束时输出的文字。有关每种appender的具体配置的例子，可以在log4net"doc"manual"example-config-appender.html中得到。</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.1.4<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>log4net.Layout.PatternLayout</strong><strong>中的转换模式(ConversionPattern)</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">%m(message):输出的日志消息，如ILog.Debug(…)输出的一条消息</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%n(new line):换行</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%d(datetime):输出当前语句运行的时刻</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%r(run time):输出程序从运行到执行到当前语句时消耗的毫秒数</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%t(thread id):当前语句所在的线程ID</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%p(priority): 日志的当前优先级别，即DEBUG、INFO、WARN…等</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%c(class):当前日志对象的名称，例如：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 模式字符串为：%-10c -%m%n</p>
<p style="margin-left: 42pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 代码为：</p>
<p style="margin-left: 73.5pt; text-indent: 21pt;">ILog log=LogManager.GetLogger(“Exam.Log”);</p>
<p style="margin-left: 73.5pt; text-indent: 21pt;">log.Debug(“Hello”);</p>
<p style="margin-left: 73.5pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; 则输出为下面的形式：</p>
<p style="margin-left: 73.5pt; text-indent: 21pt;">Exam.Log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Hello</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%L：输出语句所在的行号</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%F：输出语句所在的文件名</p>
<p style="margin-left: 42pt; text-indent: 21pt;">%-数字：表示该项的最小长度，如果不够，则用空格填充</p>
<p style="margin-left: 42pt; text-indent: 21pt;">例如，转换模式为%r [%t]%-5p %c - %m%n 的 PatternLayout 将生成类似于以下内容的输出：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">176 [main] INFOorg.foo.Bar - Located nearest gas station.</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.1.5<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>&lt;filter&gt;</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">最后，让我们看看在Appender元素里的&lt;filter&gt;标签。它定义了应用到Appender对象的过滤器。本例中，我们使用了LevelRangeFilter过滤器,它可以只记录LevelMin和LevelMax参数指定的日志级别之间的日志事件。可以在一个Appender上定义多个过滤器（Filter）,这些过滤器将会按照它们定义的顺序对日志事件进行过滤。其他过滤器的有关信息可以在log4net的SDK文档中找到。</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>3.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>使用配置文件</strong></p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.2.1<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>关联配置文件</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">当我们创建了上面的配置文件后，我们接下来需要把它和我们的应用联系起来。缺省的，每个独立的可执行程序集都会定义它自己的配置。log4net框架使用 log4net.Config.DOMConfiguratorAttribute在程序集的级别上定义配置文件。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">例如：可以在项目的AssemblyInfo.cs文件里添加以下的语句</p>
<p style="margin-left: 42pt; text-indent: 21pt;">[assembly:log4net.Config.DOMConfigurator(ConfigFile="filename", </p>
<p style="margin-left: 42pt; text-indent: 21pt;">ConfigFileExtension="ext",Watch=true/false)]</p>
<p style="margin-left: 84pt; text-indent: -21pt;">l<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>ConfigFile:</strong>指出了我们的配置文件的路径及文件名，包括扩展名。</p>
<p style="margin-left: 84pt; text-indent: -21pt;">l<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>ConfigFileExtension:</strong>如果我们对被编译程序的程序集使用了不同的文件扩展名，那么我们需要定义这个属性，缺省的，程序集的配置文件扩展名为”config”。</p>
<p style="margin-left: 84pt; text-indent: -21pt;">l<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong>Watch (Boolean</strong><strong>属性):</strong> log4net框架用这个属性来确定是否需要在运行时监视文件的改变。如果这个属性为true,那么FileSystemWatcher将会被用来监视文件的改变，重命名，删除等事件。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">其中：ConfigFile和ConfigFileExtension属性不能同时使用，ConfigFile指出了配置文件的名字，例如，ConfigFile=”Config.txt”</p>
<p style="margin-left: 42pt; text-indent: 21pt;">ConfigFileExtension则是指明了和可执行程序集同名的配置文件的扩展名，例如，应用程序的名称是”test.exe”,ConfigFileExtension=”txt”,则配置文件就应该是”test.exe.txt” ；</p>
<p style="margin-left: 42pt; text-indent: 21pt;">也可以不带参数应用DOMConfiguratio():</p>
<p style="margin-left: 42pt; text-indent: 21pt;">[assembly: log4net.Config.DOMConfigurator()]</p>
<p style="margin-left: 42pt; text-indent: 21pt;">也可以在程序代码中用DOMConfigurator类打开配置文件。类的构造函数需要一个FileInfo对象作参数，以指出要打开的配置文件名。 这个方法和前面在程序集里设置属性打开一个配置文件的效果是一样的。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">log4net.Config.DOMConfigurator.Configure(</p>
<p style="margin-left: 42pt; text-indent: 21pt;">new FileInfo("TestLogger.Exe.Config")); </p>
<p style="margin-left: 42pt; text-indent: 21pt;">DOMConfigurator 类还有一个方法ConfigureAndWatch(..), 用来配置框架并检测文件的变化。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">以上的步骤总结了和配置相关的各个方面，下面我们将分两步来使用logger对象。<br>
</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.2.2<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>创建或获取日志对象</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">日志对象会使用在配置文件里定义的属性。如果某个日志对象没有事先在配置文件里定义，那么框架会根据继承结构获取祖先节点的属性，最终的，会从根日志获取属性。如下所示：</p>
<p style="margin-left: 42pt; text-indent: 21pt;">Log4net.ILog log = Log4net.LogManager.GetLogger("MyLogger");</p>
<p style="margin-left: 70.9pt; text-indent: -1cm;"><strong>3.2.3<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>输出日志信息</strong></p>
<p style="margin-left: 42pt; text-indent: 21pt;">可以使用ILog的几种方法输出日志信息。你也可以在调用某方法前先检查IsXXXEnabled布尔变量，再决定是否调用输出日志信息的函数，这样可以提高程序的性能。因为框架在调用如ILog.Debug(…)这样的函数时，也会先判断是否满足Level日志级别条件。</p>
<p style="margin-left: 42pt; text-indent: 21pt;">if (log.IsDebugEnabled) log.Debug("message");</p>
<p style="margin-left: 42pt; text-indent: 21pt;">if (log.IsInfoEnabled) log.Info("message);</p>
<p style="margin-left: 49.6pt; text-indent: -1cm;"><strong>3.3<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>在程序中配置log4net</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">除了前面讲的用一个配置文件来配置log4net以外，还可以在程序中用代码来配置log4net框架。如下面的例子:</p>
<p style="margin-left: 21pt; text-indent: 21pt;">// 和PatternLayout一起使用FileAppender </p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator.Configure(</p>
<p style="margin-left: 21pt; text-indent: 21pt;">new log4net.Appender.FileAppender(</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp; new log4net.Layout.PatternLayout("%d </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [%t]%-5p %c [%x] - %m%n"),"testfile.log"));</p>
<p style="margin-left: 21pt; text-indent: 21pt;">// using a FileAppender with an XMLLayout</p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator.Configure( </p>
<p style="margin-left: 21pt; text-indent: 21pt;">new log4net.Appender.FileAppender( </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; new log4net.Layout.XMLLayout(),"testfile.xml"));</p>
<p style="margin-left: 21pt; text-indent: 21pt;">// using a ConsoleAppender with a PatternLayout</p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator.Configure( </p>
<p style="margin-left: 21pt; text-indent: 21pt;">new log4net.Appender.ConsoleAppender(</p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; new log4net.Layout.PatternLayout("%d </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [%t] %-5p %c - %m%n")));</p>
<p style="margin-left: 21pt; text-indent: 21pt;">// using a ConsoleAppender with a SimpleLayout</p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator.Configure(</p>
<p style="margin-left: 21pt; text-indent: 21pt;">new log4net.Appender.ConsoleAppender(new </p>
<p style="margin-left: 21pt; text-indent: 21pt;">&nbsp;&nbsp;&nbsp; log4net.Layout.SimpleLayout()));</p>
<p style="margin-left: 21pt; text-indent: 21pt;">尽管这里用代码配置log4net也很方便，但是你却不能分别配置每个日志对象。所有的这些配置都是被应用到根日志上的。</p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator 类使用静态方法Configure 设置一个Appender 对象。而Appender的构造函数又会相应的要求Layout对象。你也可以不带参数直接调用BasicConfigurator.Configure()，它会使用一个缺省的PatternLayout对象，在一个ConsoleAppender中输出信息。如下所示：</p>
<p style="margin-left: 21pt; text-indent: 21pt;">log4net.Config.BasicConfigurator.Configure();</p>
<p style="margin-left: 21pt; text-indent: 21pt;">在输出时会显示如下格式的信息：</p>
<p style="margin-left: 21pt; text-indent: 21pt;">0 [1688] DEBUG log1 A B C - Test</p>
<p style="margin-left: 21pt; text-indent: 21pt;">20 [1688] INFO log1 A B C - Test</p>
<p style="margin-left: 21pt; text-indent: 21pt;">当log4net框架被配置好以后，就可以如前所述使用日志功能了。</p>
<p style="margin-left: 21.25pt; text-indent: -21.25pt;"><strong>4<span style="font-weight: normal; font-size: 7pt; line-height: normal; font-style: normal; font-variant: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong><strong>总结</strong></p>
<p style="margin-left: 21pt; text-indent: 21pt;">使用log4net可以很方便地为应用添加日志功能。应用Log4net，使用者可以很精确地控制日志信息的输出，减少了多余信息，提高了日志记录性能。同时，通过外部配置文件，用户可以不用重新编译程序就能改变应用的日志行为，使得用户可以根据情况灵活地选择要记录的信息。</p>
  
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1033970,18036,1)"> 
		<span class="diggnum" id="digg_count_1033970">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(1033970,18036,2)"> 
		<span class="burynum" id="bury_count_1033970">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1033970">0</span>	
	<div class="diggword" id="digg_word_1033970">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a class="score-693.5483870967741 endless-pages-found-next-link" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">« </a> 上一篇：<a class="score-0" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html" title="发布于2008-01-02 17:43">excel单元格回车的使用 </a><br>
<a href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/30/1058915.html">» </a> 下一篇：<a href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/30/1058915.html" title="发布于2008-01-30 16:21">log4Net中的StackTrace</a><br>
</div>








	<div class="postDesc">posted on 2008-01-10 17:14 <a href="http://www.cnblogs.com/lwlzyjl/">最远距离</a> 阅读(156) <a href="#commentform">评论(0)</a> &nbsp;<a href="http://www.cnblogs.com/lwlzyjl/admin/EditPosts.aspx?postid=1033970">编辑</a> <a href="http://www.cnblogs.com/lwlzyjl/AddToFavorite.aspx?id=1033970">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  </div>
</div>
<img src="1033970.html" height="1" width="1">

<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html"
dc:identifier="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/lwlzyjl/services/trackbacks/1033970.aspx" />
</rdf:RDF>
-->



<div id="ctl05_comment_form" class="commentform">




<div id="ctl05_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2flwlzyjl%2farchive%2f2008%2f01%2f10%2f1033970.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2flwlzyjl%2farchive%2f2008%2f01%2f10%2f1033970.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55127/" target="_top">苹果再度反击 要求ITC封杀诺基亚</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55126/" target="_top">【快乐周末】Google 最新产品： Google Toilet</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55125/" target="_top">纽约时报：Google与中国</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55124/" target="_top">Google 退出中国事件的一些细节解释</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55119/" target="_top">Mozilla扩建数据中心支撑Firefox研发</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_3.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_4.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1033970/">Log4Net使用指南</a></div>

</div>


				
	
<!--done-->
<div class="footer">
	
	Copyright ©2010 最远距离 Powered by: <a href="http://www.cnblogs.com/" class="footerlink">博客园</a> 模板提供：<a href="http://blog.hjenglish.com/" class="footerlink">沪江博客</a><br>
</div>
</div>



    </form>
	
	
      
    
    
    
<div style="margin-top: 0px; padding-top: 0px;" id="loaded-by-endless-pages"><div class="endless-pages-page-break"><div class="endless-pages-page-break-desc">- <img class="smarterfox-icon" src="smarterfox-logo.png"><a class="endless-pages-page-break-link" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">Page 2</a> -</div></div><div style="padding-top: 54px;" class="endless-pages-loaded-page">
    <form name="Form1" method="post" action="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1023531.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        
<!--done-->
<div id="header">
	
<!--done-->
<div class="header">
	<div class="headerText">
		<a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/lwlzyjl/">最远距离</a><br>
		                    ---.Net之路
	</div>
</div>

</div>
<div id="mylinks">
<!--done-->
<a id="MyLinks1_HomeLink" class="menu" href="http://www.cnblogs.com/">博客园</a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/lwlzyjl/">首页</a>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/%e6%9c%80%e8%bf%9c%e8%b7%9d%e7%a6%bb">联系</a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/lwlzyjl/rss">订阅</a><a id="MyLinks1_XMLLink" href="http://www.cnblogs.com/lwlzyjl/rss"><img src="xml.gif" alt="订阅" style="border-width: 0px;"></a>&nbsp;&nbsp;&nbsp;
<a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/lwlzyjl/admin/EditPosts.aspx">管理</a>
</div>
<div id="mytopmenu">
	
		
<div class="blogStats">随笔 - 29&nbsp;
文章 - 1&nbsp;评论 - 76&nbsp;trackbacks - 2
</div>
	
</div>
<div id="leftcontent">
	
		<div id="leftcontentcontainer">
			<br>
			
<!--done-->
<div class="newsItem">
	<div id="ads" style="border: 1px solid rgb(169, 214, 226); margin: 10px 0px 6px; clear: both; width: 180px;">


<h3 style="border-bottom: 1px dashed rgb(161, 216, 230); padding: 2px 0px 0px 12px; font-size: 12px; color: rgb(102, 102, 102); line-height: 24px; height: 24px; text-align: left;">赞助商广告</h3>


<br>
 

</div>
<div id="profile_block"><a href="http://home.cnblogs.com/lwlzyjl/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/lwlzyjl/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/lwlzyjl/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e6%9c%80%e8%bf%9c%e8%b7%9d%e7%a6%bb" target="_top">发短消息</a></div>
</div>

			

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<h3>常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/lwlzyjl/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl01_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl01_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/lwlzyjl/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl01_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/lwlzyjl/tag/">我的标签</a></li>
	</ul>
</div>
<!--done-->

		<h1 class="catListTitle">随笔分类</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89131.html">Ajax</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to Ajax" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89131.html/rss"><img title="Subscribe to Ajax" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89043.html">Asp.net(2)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to Asp.net(2)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89043.html/rss"><img title="Subscribe to Asp.net(2)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/200093.html">Asp.Net MVC开发指南</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to Asp.Net MVC开发指南" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/200093.html/rss"><img title="Subscribe to Asp.Net MVC开发指南" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89042.html">C#(6)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to C#(6)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89042.html/rss"><img title="Subscribe to C#(6)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89044.html">JavaScript</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to JavaScript" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89044.html/rss"><img title="Subscribe to JavaScript" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89045.html">XML</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to XML" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89045.html/rss"><img title="Subscribe to XML" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/197675.html">翻译文章</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to 翻译文章" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/197675.html/rss"><img title="Subscribe to 翻译文章" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/97199.html">日常积累(3)</a><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to 日常积累(3)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/97199.html/rss"><img title="Subscribe to 日常积累(3)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">随笔档案</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2009/04.html">2009年4月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/12.html">2008年12月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/08.html">2008年8月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05.html">2008年5月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04.html">2008年4月 (4)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01.html">2008年1月 (3)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11.html">2007年11月 (8)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/10.html">2007年10月 (3)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/09.html">2007年9月 (5)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl10_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/08.html">2007年8月 (1)</a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl11_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/archive/2007/06.html">2007年6月 (1)</a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">文章分类</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89046.html">.Net</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to .Net" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/89046.html/rss"><img title="Subscribe to .Net" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/132159.html">Spring.Net(1)</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to Spring.Net(1)" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/132159.html/rss"><img title="Subscribe to Spring.Net(1)" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_Link" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/130788.html">漫谈设计模式</a><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to 漫谈设计模式" class="listitem" href="http://www.cnblogs.com/lwlzyjl/category/130788.html/rss"><img title="Subscribe to 漫谈设计模式" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">好友的Blog</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_Link" class="listitem" href="http://www.6868368.com/">奇特淘宝网</a></li>
			<li style="margin-top: 2px;">奇特淘宝网</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl02_Link" class="listitem" href="http://hunbj.cn/" target="_top">我的个人网站</a></li>
			<li style="margin-top: 2px;">混北京网站</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_Link" class="listitem" href="http://www.blogjava.net/Alex-Lee/default.aspx" target="_top">小颀的Java窝</a><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_RssLink" title="Subscribe to 小颀的Java窝" class="listitem" href="http://www.blogjava.net/Alex-Lee/default.aspx"><img title="Subscribe to 小颀的Java窝" src="xml_001.gif" style="border-width: 0px;"></a></li>
			
				</ul>
			
	
		<h1 class="catListTitle">牛人的Blog</h1>
		
				<ul class="catList">
			
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl01_Link" class="listitem" href="http://juqiang.cnblogs.com/" target="_top">鞠强的Blog</a></li>
			<li style="margin-top: 2px;">Inspur出去的高手, 敬仰之~!</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl02_Link" class="listitem" href="http://blog.csdn.net/eparg" target="_top">熊力的Blog</a><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl02_RssLink" title="Subscribe to 熊力的Blog" class="listitem" href="http://blog.csdn.net/eparg/Rss.aspx"><img title="Subscribe to 熊力的Blog" src="xml_001.gif" style="border-width: 0px;"></a></li>
			<li style="margin-top: 2px;">据说是个调试的高手,想买他的书看看!</li>
				<li class="catListItem"> <a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl03_Link" class="listitem" href="http://blog.joycode.com/wayfarer/" target="_top">张逸:晴窗笔记</a></li>
			<li style="margin-top: 2px;">WCF的牛人！</li>
				</ul>
			
	


<h3>积分与排名</h3>
<ul>
	<li>
		积分 -
		22167
	</li><li>
		排名 -
		3134
	</li>
</ul>

<h3 class="catListTitle">最新评论
	<a id="SingleColumn1__2e3d8b6_RSSHyperlink1" href="http://www.cnblogs.com/lwlzyjl/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3>
<div class="RecentComment" id="RecentComments">
	
			<ul>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#1735143">1.&nbsp;Re:excel单元格回车的使用 </a>
			</li>
			<li style="">
				非常感谢哈 一直为之个问题头疼哈
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--alisx</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#1733450">2.&nbsp;Re:excel单元格回车的使用 </a>
			</li>
			<li style="">
				非常感谢，及时解决了工作中的问题
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--某某1</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html#1695038">3.&nbsp;Re:Spring.Net入门篇（二）概述 </a>
			</li>
			<li style="">
				写这篇概述，实在让我感觉捉肘见襟，不停的翻阅材料，也许一年以后我再看这篇的文章的时候会发现现在的我是多么的幼稚和可笑，但是我还是写出来了，当作对逝去的时光的一个总结吧！


楼主，你现在看时，可千万别...
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--梅桦</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/12/11/1353112.html#1688875">4.&nbsp;Re:大型网站架构演变和知识体系(转)</a>
			</li>
			<li style="">
				受教了！
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--孤独之影</li>
		
			<li style="">
				<a id="SingleColumn1__2e3d8b6_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html#1672907">5.&nbsp;Re:Spring.Net入门篇（二）概述 </a>
			</li>
			<li style="">
				看得真是太爽啦!

			</li>
			<li style="text-align: right; margin-right: 4px;">
				--我是一只小老虎 喵!</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">阅读排行榜</h3>
<div class="RecentComment" id="TopViewPosts"> 
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/18/1159712.html">1.&nbsp;Spring.Net入门篇（一）(4349)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/08/1142382.html">2.&nbsp;.Net的序列化和反序列化(3605)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html">3.&nbsp;Spring.Net入门篇（二）概述 (3523)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">4.&nbsp;excel单元格回车的使用 (2213)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl04_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/08/953258.html">5.&nbsp;NuSoap介绍（转）(1154)</a>
			</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">评论排行榜</h3>
<div class="RecentComment" id="TopCommentsPosts">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/05/07/1186699.html">1.&nbsp;Spring.Net入门篇（二）概述 (31)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/18/1159712.html">2.&nbsp;Spring.Net入门篇（一）(21)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/04/08/1142382.html">3.&nbsp;.Net的序列化和反序列化(10)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">4.&nbsp;excel单元格回车的使用 (8)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl05_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/15/960294.html">5.&nbsp;用Axis开发Webservice(2)</a>
			</li>
		
			</ul>
		
</div></div>		
	
</div>
<div id="centercontent">
	
					
<!--done-->
<div class="post">
	<div class="postTitle">
		<h1><a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html">excel单元格回车的使用 </a></h1>
	</div>
	<p>excel单元格回车的使用</p>
<p>每次在操作excel&nbsp;单元格的时候,想让单元格中内容回车,直接按回车却不管用,最近</p>
<p>终于发现是按alt+enter(alt+回车键).</p>

<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1023531,18036,1)"> 
		<span class="diggnum" id="digg_count_1023531">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(1023531,18036,2)"> 
		<span class="burynum" id="bury_count_1023531">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1023531">0</span>	
	<div class="diggword" id="digg_word_1023531">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/15/960294.html">« </a> 上一篇：<a href="http://www.cnblogs.com/lwlzyjl/archive/2007/11/15/960294.html" title="发布于2007-11-15 13:36">用Axis开发Webservice</a><br>
<a href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html">» </a> 下一篇：<a href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/10/1033970.html" title="发布于2008-01-10 17:14">Log4Net使用指南</a><br>
</div>








	<div class="postDesc">posted on 2008-01-02 17:43 <a href="http://www.cnblogs.com/lwlzyjl/">最远距离</a> 阅读(2213) <a href="#commentform">评论(8)</a> &nbsp;<a href="http://www.cnblogs.com/lwlzyjl/admin/EditPosts.aspx?postid=1023531">编辑</a> <a href="http://www.cnblogs.com/lwlzyjl/AddToFavorite.aspx?id=1023531">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/lwlzyjl/category/97199.html">日常积累</a></div>
</div>
<img src="1023531.html" height="1" width="1">

<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html"
dc:identifier="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/lwlzyjl/services/trackbacks/1023531.aspx" ></rdf>
</rdf:RDF>
-->

<a name="pagedcomment"></a>
<!--done-->
<br>
<b>FeedBack:</b>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1735143</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1081284">#1楼</a><a name="1081284" id="comment_anchor_1081284"></a>&nbsp;2008-02-25 21:12&nbsp;<a id="Comments1_CommentList_ctl00_NameLink" target="_blank">321[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1081284" class="blog_comment_body">太谢谢了，我正为此烦恼呢</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("321",1081284,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1081284,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1214632">#2楼</a><a name="1214632" id="comment_anchor_1214632"></a>&nbsp;2008-05-31 21:01&nbsp;<a id="Comments1_CommentList_ctl01_NameLink" target="_blank">awning[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1214632" class="blog_comment_body">谢谢帮忙！！</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("awning",1214632,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1214632,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1272247">#3楼</a><a name="1272247" id="comment_anchor_1272247"></a>&nbsp;2008-07-30 14:15&nbsp;<a id="Comments1_CommentList_ctl02_NameLink" target="_blank">45635434[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1272247" class="blog_comment_body">好人</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("45635434",1272247,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1272247,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1447527">#4楼</a><a name="1447527" id="comment_anchor_1447527"></a>&nbsp;2009-02-10 15:58&nbsp;<a id="Comments1_CommentList_ctl03_NameLink" target="_blank">并按[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1447527" class="blog_comment_body">太有用了！</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("并按",1447527,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1447527,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1538805">#5楼</a><a name="1538805" id="comment_anchor_1538805"></a>&nbsp;2009-05-26 15:57&nbsp;<a id="Comments1_CommentList_ctl04_NameLink" target="_blank">潘生[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1538805" class="blog_comment_body">非常感谢你好心人</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("潘生",1538805,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1538805,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1667730">#6楼</a><a name="1667730" id="comment_anchor_1667730"></a>&nbsp;2009-10-09 15:26&nbsp;<a id="Comments1_CommentList_ctl05_NameLink" target="_blank">感谢你楼主[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1667730" class="blog_comment_body">谢谢了，呵呵</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("感谢你楼主",1667730,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1667730,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1733450">#7楼</a><a name="1733450" id="comment_anchor_1733450"></a>&nbsp;2009-12-25 13:36&nbsp;<a id="Comments1_CommentList_ctl06_NameLink" target="_blank">某某1[未注册用户]</a></div>
				<div align="left"><span id="comment_body_1733450" class="blog_comment_body">非常感谢，及时解决了工作中的问题</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("某某1",1733450,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1733450,"")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink"></a>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
			<div class="feedbacktitle"><a href="#1735143">#8楼</a><a name="1735143" id="comment_anchor_1735143"></a><a name="Post"></a>&nbsp;2009-12-28 09:04&nbsp;<a id="Comments1_CommentList_ctl07_NameLink" href="http://www.cnblogs.com/alisx/" target="_top">alisx</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/alisx" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></div>
				<div align="left"><span id="comment_body_1735143" class="blog_comment_body">非常感谢哈 一直为之个问题头疼哈</span><br>&nbsp;&nbsp;<a onclick='ReplyComment("alisx",1735143,"2ERabhoHlRheUNLO1jq0Q5VG4dSP6B10xh3kaS6hiMMoHMt7gBe6Eg==")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1735143,"2ERabhoHlRheUNLO1jq0Q5VG4dSP6B10xh3kaS6hiMMoHMt7gBe6Eg==")' href="http://www.cnblogs.com/lwlzyjl/archive/2008/01/02/1023531.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=alisx" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl07$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_EditLink"></a>
			</div>
		</div>
	

<div id="ctl05_comment_form" class="commentform">




<div id="ctl05_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2flwlzyjl%2farchive%2f2008%2f01%2f02%2f1023531.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2flwlzyjl%2farchive%2f2008%2f01%2f02%2f1023531.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55138/" target="_top">苹果Vs谷歌：手机领域谁怕谁？</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55137/" target="_top">摩托罗拉：豪赌Android的希望与隐忧</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55136/" target="_top">分众新坐标：楼宇是过去 未来在手机和互联网</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55135/" target="_top">结盟零售蚁族 淘宝欲造10亿新网民</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55134/" target="_top">下代Android系统命名冻酸奶</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>

<br>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=%e6%97%a5%e5%b8%b8%e7%a7%af%e7%b4%af" target="_top">日常积累</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1023531/">excel单元格回车的使用 </a></div>

</div>


				
	
<!--done-->
<div class="footer">
	
	Copyright ©2010 最远距离 Powered by: <a href="http://www.cnblogs.com/" class="footerlink">博客园</a> 模板提供：<a href="http://blog.hjenglish.com/" class="footerlink">沪江博客</a><br>
</div>
</div>



    </div>
	
	
      
    
    
    
</div></div></div></div></div></div></div></form></div></div></body>
</html>
